package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TRkReceivingGoodsMapper;
import com.ruoyi.system.domain.TRkReceivingGoods;
import com.ruoyi.system.service.ITRkReceivingGoodsService;

/**
 * 入库单Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-03
 */
@Service
public class TRkReceivingGoodsServiceImpl implements ITRkReceivingGoodsService 
{
    @Autowired
    private TRkReceivingGoodsMapper tRkReceivingGoodsMapper;

    /**
     * 查询入库单
     * 
     * @param id 入库单主键
     * @return 入库单
     */
    @Override
    public TRkReceivingGoods selectTRkReceivingGoodsById(String id)
    {
        return tRkReceivingGoodsMapper.selectTRkReceivingGoodsById(id);
    }

    /**
     * 查询入库单列表
     * 
     * @param tRkReceivingGoods 入库单
     * @return 入库单
     */
    @Override
    public List<TRkReceivingGoods> selectTRkReceivingGoodsList(TRkReceivingGoods tRkReceivingGoods)
    {
        return tRkReceivingGoodsMapper.selectTRkReceivingGoodsList(tRkReceivingGoods);
    }

    /**
     * 新增入库单
     * 
     * @param tRkReceivingGoods 入库单
     * @return 结果
     */
    @Override
    public int insertTRkReceivingGoods(TRkReceivingGoods tRkReceivingGoods)
    {
        tRkReceivingGoods.setCreateTime(DateUtils.getNowDate());
        return tRkReceivingGoodsMapper.insertTRkReceivingGoods(tRkReceivingGoods);
    }

    /**
     * 修改入库单
     * 
     * @param tRkReceivingGoods 入库单
     * @return 结果
     */
    @Override
    public int updateTRkReceivingGoods(TRkReceivingGoods tRkReceivingGoods)
    {
        tRkReceivingGoods.setUpdateTime(DateUtils.getNowDate());
        return tRkReceivingGoodsMapper.updateTRkReceivingGoods(tRkReceivingGoods);
    }

    /**
     * 批量删除入库单
     * 
     * @param ids 需要删除的入库单主键
     * @return 结果
     */
    @Override
    public int deleteTRkReceivingGoodsByIds(String[] ids)
    {
        return tRkReceivingGoodsMapper.deleteTRkReceivingGoodsByIds(ids);
    }

    /**
     * 删除入库单信息
     * 
     * @param id 入库单主键
     * @return 结果
     */
    @Override
    public int deleteTRkReceivingGoodsById(String id)
    {
        return tRkReceivingGoodsMapper.deleteTRkReceivingGoodsById(id);
    }
}
